<template>
  <div class="content content51">
    <div class="innertitle">
      1.剂量特性<span style="font-weight: normal;margin-left: 20px;">温度：<el-input v-model="form.doseCharacteristics.temperature" class="input-line" />℃，气压：<el-input v-model="form.doseCharacteristics.pressure" class="input-line" />hPa<el-date-picker
      v-model="form.doseCharacteristics.date"
      type="date"
      placeholder="选择日期">
    </el-date-picker></span>
    </div>
    <div class="innertitle">
      1.1 剂量偏差与重复性（剂量）：
    </div>
    <div>
      机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.repeatability.ntd" class="input-line" />cm， 预设剂量：2Gy。<i>$N_k$</i>：<el-input v-model="form.repeatability.nk" class="input-line" />
    </div>
   <table border="1" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td rowspan="2">辐射类型</td>
        <td rowspan="2">临床常用能量档</td>
        <td rowspan="2">剂量率</td>
        <td rowspan="2"><el-radio v-model="form.repeatability.beamType" :label="1">照射野</el-radio>
            <el-radio v-model="form.repeatability.beamType" :label="2">限光筒</el-radio></td>
        <td :colspan="repeatability.table.td">测量吸收剂量值（Gy）</td>
        <td rowspan="2">CV</td>
        <td rowspan="2"><i>$S_{w,air}$</i></td>
        <td rowspan="2"><i>$P_u$</i></td>
        <td rowspan="2">水深<br/>（cm）</td>
        <td rowspan="2"><i>$P_{cel}$</i></td>
        <td rowspan="2">偏差<br/>（%）</td>
      </tr>
      <tr>
        <td v-for="tdIndex in repeatability.table.td" :key="tdIndex" v-html="'<i>$R_'+tdIndex+'$</i>'"></td>
      </tr>
      <tr v-for="trIndex in repeatability.table.tr" :key="trIndex">
        <td><el-input v-model="form.repeatability['type_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['energy_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['doseRate_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['irradiation_'+trIndex]" class="input-line" /></td>
        <td v-for="tdIndex in repeatability.table.td" :key="tdIndex">
          <el-input v-model="form.repeatability['r_'+tdIndex+'_'+trIndex]" class="input-line" />
        </td>
        <td><el-input v-model="form.repeatability['cv_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['s_w_air_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['p_u_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['depth_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['p_cel_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.repeatability['error_'+trIndex]" class="input-line" /></td>
      </tr>
    </table>
    <div class="latex">
      公式：<i>$实测值 = 平均值 \times N_K \times (1-g) \times K_m \times K_{att} \times S_{w,air} \times P_u \times P_{cel},偏差 = \frac {实测值-预设值}{预设值} \times 100 \%$</i>
    </div>
    <div class="latex">
      <i>$CV=\frac {1}{\overline R} \sqrt {\Sigma (R_i - \overline R)^2 / (n-1)} \times 100 \%$</i> <i>$R = \frac {1}{n}  \Sigma^n_{i=1} R_i,K_m、K_{att}、S_{w,air}、P_u、P_{cel}$</i>见IAEA TRS-277号报告
    </div>
    <div class="innertitle">
      1.2 随设备角度位置变化 <el-checkbox v-model="form.changePosition.isTest" :true-label="1" :false-label="0">验收检测不检测此类项目</el-checkbox>
    </div>
    <div v-show="!form.changePosition.isTest">
      <template v-for="tbodyIndex in changePosition.table.tbody">
        <div>
          线束系统：0°，NTD：<el-input v-model="form.changePosition['ntd_'+tbodyIndex]" class="input-line" />cm，FS：10cm×10cm， X射线，临床常用能量：<el-input v-model="form.changePosition['energy_'+tbodyIndex]" class="input-line" />MV，剂量率：<el-input v-model="form.changePosition['doseRate_'+tbodyIndex]" class="input-line" />Gy/min，
        </div>
        <div>预设剂量：2Gy</div>
        <table border="1" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td rowspan="2">机架角度（°）</td>
            <td :colspan="changePosition.table.td">测量吸收剂量值（Gy）</td>
            <td rowspan="2">均值（Gy）</td>
          </tr>
          <tr>
            <td v-for="tdIndex in changePosition.table.td" :key="tdIndex" v-html="'<i>$D_'+tdIndex+'$</i>'"></td>
          </tr>
          <tr v-for="(trItem,trIndex) in changePosition.table.tr" :key="trIndex">
            <td>{{trItem}}</td>
            <td v-for="tdIndex in changePosition.table.td"><el-input v-model="form.changePosition['value_'+tbodyIndex+'_D'+tdIndex+'_'+trItem]" class="input-line" /></td>
            <td v-if="trIndex == 0" :rowspan="changePosition.table.tr.length"><el-input v-model="form.changePosition['average_'+tbodyIndex]" class="input-line" /></td>
          </tr>
          <tr>
            <td>偏差（%）</td>
            <td :colspan="changePosition.table.td+1"><el-input v-model="form.changePosition['error_'+tbodyIndex]" class="input-line" /></td>
          </tr>
        </table>
      </template>
      <div>
        公式:<i>$R=\frac {(\overline {D_1} - \overline {D_2})}{\overline D_1}$</i>
      </div>
    </div>
    <div class="innertitle">
      1.3 随机架旋转的变化（剂量） <el-checkbox v-model="form.rotationalVariation.isTest" :true-label="1" :false-label="0">验收检测不检测此类项目</el-checkbox>
    </div>
    <div v-show="!form.rotationalVariation.isTest">
      <template v-for="tbodyIndex in rotationalVariation.table.tbody">
        <div>
            线束系统：0°，NTD：<el-input v-model="form.rotationalVariation['ntd_'+tbodyIndex]" class="input-line" />cm，FS：10cm×10cm，{{tbodyIndex==1?'X射线':'电子线'}} ，临床常用能量：<el-input v-model="form.changePosition['energy_'+tbodyIndex]" class="input-line" />M<span v-if="tbodyIndex != 1">e</span>V，剂量率：<el-input v-model="form.changePosition['doseRate_'+tbodyIndex]" class="input-line" />Gy/min，预设剂量：2Gy
        </div>
        <table border="1" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td rowspan="2" colspan="2">机架角度（°）</td>
            <td :colspan="rotationalVariation.table.td">测量吸收剂量值（Gy）</td>
            <td rowspan="2">均值（Gy）</td>
          </tr>
         <tr>
            <td v-for="tdIndex in rotationalVariation.table.td" :key="'tdIndex'+tbodyIndex+tdIndex" v-html="'<i>$D_'+tdIndex+'$</i>'"></td>
          </tr>
          <tr v-for="trIndex in rotationalVariation.table.tr" :key="'trIndex0'+trIndex">
            <td :rowspan="rotationalVariation.table.tr" v-if="trIndex == 1">0~90</td>
            <td><el-input v-model="form.rotationalVariation['angle_'+tbodyIndex+'_0_'+trIndex]" class="input-line" /></td>
            <td v-for="tdIndex in rotationalVariation.table.td" :key="'tdIndex'+tbodyIndex+tdIndex"><el-input v-model="form.rotationalVariation['value_'+tbodyIndex+'_0_'+trIndex+'_D'+tdIndex]" class="input-line" /></td>
            <td :rowspan="rotationalVariation.table.tr *2" v-if="trIndex == 1"><el-input v-model="form.rotationalVariation['average_'+tbodyIndex]" class="input-line" /></td>
          </tr>
          <tr v-for="trIndex in rotationalVariation.table.tr" :key="'trIndex180'+trIndex">
            <td :rowspan="rotationalVariation.table.tr" v-if="trIndex == 1">90~180</td>
            <td><el-input v-model="form.rotationalVariation['angle_'+tbodyIndex+'_180_'+trIndex]" class="input-line" /></td>
            <td v-for="tdIndex in rotationalVariation.table.td" :key="'tdIndex'+tbodyIndex+tdIndex"><el-input v-model="form.rotationalVariation['value_'+tbodyIndex+'_180_'+trIndex+'_D'+tdIndex]" class="input-line" /></td>
          </tr>
          <tr>
            <td>偏差（%）</td>
            <td :colspan="rotationalVariation.table.td+2"><el-input v-model="form.rotationalVariation['error_'+tbodyIndex]" class="input-line" /></td>
          </tr>
        </table>
      </template>
      <div class="latex">
        <i>$公式:D_A = \frac {(D_{max} - D_{min})}{\overline D}$</i>
      </div>
    </div>
    <div class="innertitle">
      1.4 日稳定性
    </div>
    <div>
        机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.dailyStability.ntd" class="input-line" />cm，FS：10cm×10cm，  剂量率：<el-input v-model="form.dailyStability.doseRate" class="input-line" />Gy/min，预设剂量：2Gy。
    </div>
    <table border="1" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td rowspan="2">检测时间</td>
        <td :colspan="dailyStability.table.td">测量吸收剂量值（Gy）</td>
        <td rowspan="2"><i>$\overline D$</i>均值（Gy）</td>
        <td rowspan="2">R结果（%）</td>
      </tr>
      <tr>
        <td v-for="tdIndex in dailyStability.table.td" :key="tdIndex"  v-html="'<i>$D_'+tdIndex+'$</i>'"></td>
      </tr>
      <tr v-for="trIndex in dailyStability.table.tr" :key="trIndex">
        <td><el-input v-model="form.dailyStability['testTime_'+trIndex]" class="input-line" /></td>
        <td v-for="tdIndex in dailyStability.table.td" :key="tdIndex">
          <el-input v-model="form.dailyStability['value_'+trIndex+'_D'+tdIndex]" class="input-line" />
        </td>
        <td><el-input v-model="form.dailyStability['average_'+trIndex]" class="input-line" /></td>
        <td :rowspan="dailyStability.table.tr" v-if="trIndex == 1"><el-input v-model="form.dailyStability.result" class="input-line" /></td>
      </tr>
    </table>
    <div class="latex">
      <i>$公式:R = \frac {\overline {D_1} - \overline {D_2}} {\overline {D_1}}$</i>
    </div>
    <div class="innertitle">
      1.5 线性
    </div>
    <div class="latex">
      <i>$公式:D_{ij} = \frac {1}{5} \Sigma ^5_{i=1}D_{ijn},D_i = \frac {1}{4}\Sigma ^4_{j=1}D_{ij},D_i = \frac {1}{5}\Sigma^5_{i=1}D_{in},D_j = \frac{1}{5}\Sigma ^5_{j=1}D_{jn},$</i>
    </div>
    <template v-for="tbodyIndex in linearity.table.tbody">
      <div>机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.linearity['ntd_'+tbodyIndex]" class="input-line" />cm，FS：10cm×10cm，<el-radio-group v-model="form.linearity['beamType_'+tbodyIndex]">
    <el-radio :label="1">X射线</el-radio>
    <el-radio :label="2">电子线</el-radio>
  </el-radio-group>能量：<el-input v-model="form.linearity['energy_'+tbodyIndex]" class="input-line" />
剂量：<el-input v-model="form.linearity['dose_'+tbodyIndex]" class="input-line" />Gy</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td :rowspan="2">预设吸收剂量率（Gy/min）</td>
          <td :colspan="linearity.table.td1">测量吸收剂量值（Gy/min）</td>
          <td :rowspan="2">均值（Gy/min）</td>
        </tr>
        <tr>
          <td v-for="tdIndex in linearity.table.td1" :key="'tdInex'+tbodyIndex+tdIndex" v-html="'<i>$D_'+tdIndex+'$</i>'"></td>
        </tr>
        <tr v-for="trIndex in linearity.table.tr1" :key="trIndex">
          <td><el-input v-model="form.linearity['value_doseRate_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
          <td v-for="tdIndex in linearity.table.td1" :key="'tdInex'+tbodyIndex+tdIndex"><el-input v-model="form.linearity['value_'+tbodyIndex+'_dose_D'+tdIndex+'_'+trIndex]" class="input-line" /></td>
          <td><el-input v-model="form.linearity['average_dose_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
        </tr>
      </table>
      <div>剂量率：<el-input v-model="form.linearity['doseRate_'+tbodyIndex]" class="input-line" />Gy/min</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td :rowspan="2">预设吸收剂量（Gy）</td>
          <td :colspan="linearity.table.td2">测量吸收剂量值（Gy）</td>
          <td :rowspan="2">均值（Gy））</td>
        </tr>
        <tr>
          <td v-for="tdIndex in linearity.table.td2" :key="'tdInex'+tbodyIndex+tdIndex" v-html="'<i>$D_'+tdIndex+'$</i>'"></td>
        </tr>
        <tr v-for="trIndex in linearity.table.tr2" :key="trIndex">
          <td><el-input v-model="form.linearity['value_dose_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
          <td v-for="tdIndex in linearity.table.td2" :key="'tdInex'+tbodyIndex+tdIndex"><el-input v-model="form.linearity['value_'+tbodyIndex+'_doseRate_D'+tdIndex+'_'+trIndex]" class="input-line" /></td>
          <td><el-input v-model="form.linearity['average_doseRate_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
        </tr>
      </table>
    </template>
    <div class="innertitle">
      2.深度吸收剂量特性、照射野的均整度和对称性、半影
    </div>
    <div class="innertitle">
      2.1 X射线的PDD曲线数据
    </div>
    <div>
      机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.pdd.ntd" class="input-line" />cm，FS：10cm×10cm，剂量率：<el-input v-model="form.pdd.doseRate" class="input-line" />Gy/min，预设剂量：10Gy。
    </div>
    <table border="1" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td :rowspan="2">临床常用能量档（MV）</td>
        <td colspan="2"><i>$R_{100}$</i>（cm）</td>
        <td colspan="2"><el-radio-group v-model="form.pdd.energyType">
    <el-radio :label="1"><i>$D_{20}/D_{10}$</i></el-radio>
    <el-radio :label="2"><i>$TPR_{20,10}$</i></el-radio>
  </el-radio-group></td>
        <td :rowspan="2"><i>$D_{10}$</i>（%）</td>
        <td :rowspan="2"><i>$D_{5}$</i>（%）</td>
      </tr>
      <tr>
        <td>规定值</td>
        <td>测量值</td>
        <td>规定值</td>
        <td>测量值</td>
      </tr>
      <tr v-for="trIndex in pdd.table.tr" :key="trIndex">
        <td><el-input v-model="form.pdd['energy_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['specifiedValue_1_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['testValue_1_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['specifiedValue_2_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['testValue_2_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['value_D10_'+trIndex]" class="input-line" /></td>
        <td><el-input v-model="form.pdd['value_D5_'+trIndex]" class="input-line" /></td>
      </tr>
    </table>
    <div class="innertitle">
      2.2 X射线的Profile曲线数据
    </div>
    <div>
      机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.xProfile.ntd" class="input-line" />cm，剂量率：<el-input v-model="form.xProfile.doseRate" class="input-line" />Gy/min，预设剂量：10Gy。
    </div>
    <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td rowspan="2">能量档 <br/>（MV）</td>
          <td rowspan="2">标准检测深度<br/>（cm）</td>
          <td rowspan="2">照射野<br/>（cm）</td>
          <td rowspan="2">方向</td>
          <td rowspan="2">均整度<br/>（%）</td>
          <td rowspan="2">对称性<br/>（%）</td>
          <td colspan="2">检测半影<br/>（mm）</td>
          <td colspan="2">厂家给定半影值<br/>（mm）</td>
        </tr>
        <tr>
          <td>左</td>
          <td>右</td>
          <td>左</td>
          <td>右</td>
        </tr>
        <tbody v-for="tbodyIndex in xProfile.table.tbody" :key="tbodyIndex">
          <template v-for="tbody2Index in xProfile.table.tbody2">
            <tr v-for="(trItem,trIndex) in xProfile.table.tr" :key="'trIndex'+tbodyIndex+tbody2Index+trIndex">
              <td v-if="tbody2Index == 1 && trIndex==0" :rowspan="xProfile.table.tr.length * xProfile.table.tbody2"><el-input v-model="form.xProfile['energy_'+tbodyIndex]" class="input-line" /></td>
              <td v-if="tbody2Index == 1 && trIndex == 0" :rowspan="xProfile.table.tr.length * xProfile.table.tbody2"><el-input v-model="form.xProfile['depth_'+tbodyIndex]" class="input-line" /></td>
              <td v-if="trIndex == 0" :rowspan="xProfile.table.tr.length">
                <div class="multipleInput">
                  <div style="display: flex;">
                    <el-input v-model="form.xProfile['irradiationField_'+tbodyIndex+'_'+tbody2Index+'_left']" class="input-line" /><i>$\times$</i><el-input v-model="form.xProfile['irradiationField_'+tbodyIndex+'_'+tbody2Index+'_right']" class="input-line" /></div>
                  </div>

              </td>
              <td>
                {{trItem}}
              </td>
              <td><el-input v-model="form.xProfile['uniformity_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
              <td><el-input v-model="form.xProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
              <td><el-input v-model="form.xProfile['detectPenumbra_left_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
              <td><el-input v-model="form.xProfile['detectPenumbra_right_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
              <td><el-input v-model="form.xProfile['detectPenumbra_factory_left_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
              <td><el-input v-model="form.xProfile['detectPenumbra_factory_right_'+tbodyIndex+'_'+tbody2Index+'_'+trItem]" class="input-line" /></td>
            </tr>
          </template>
        </tbody>
      </table>
      <div class="innertitle">
        2.3 电子线的PDD曲线数据
      </div>
      <div>
        机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.curveDataPdd.ntd" class="input-line" />cm，FS：10cm×10cm，剂量率：<el-input v-model="form.curveDataPdd.doseRate" class="input-line" />Gy/min，预设剂量：10Gy。
      </div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td rowspan="2">临床常用能量档 <br/>（MeV）</td>
            <td rowspan="2">限光筒尺寸 <br/>（cm×cm）</td>
            <td rowspan="2"><i>$R_{100}$</i> <br/>（cm）</td>
            <td colspan="2"><i>$R_{p}$</i>（cm）</td>
            <td rowspan="2"><i>$R_{90}$</i> <br/>（cm）</td>
            <td rowspan="2"><i>$R_{80}$</i> <br/>（cm）</td>
            <td rowspan="2"><i>$E_{0}$</i> <br/>（MeV）</td>
          </tr>
          <tr>
            <td>规定值</td>
            <td>测量值</td>
          </tr>
          <tr v-for="trIndex in curveDataPdd.table.tr" :key="trIndex">
            <td><el-input v-model="form.curveDataPdd['energy_'+trIndex]" class="input-line" /></td>
            <td class="multipleInput">
              <div style="display: flex;">
                <el-input v-model="form.curveDataPdd['limit_'+trIndex+'_left']" class="input-line" /><i>$\times$</i><el-input v-model="form.curveDataPdd['limit_'+trIndex+'_right']" class="input-line" />
              </div>
            </td>
            <td><el-input v-model="form.curveDataPdd['r100_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.curveDataPdd['rp_specifiedValue_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.curveDataPdd['rp_testValue_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.curveDataPdd['r90_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.curveDataPdd['r80_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.curveDataPdd['E0_'+trIndex]" class="input-line" /></td>
          </tr>
        </table>
        <div class="innertitle">
          2.4 电子线的Profile曲线数据
        </div>
        <div>机架角度：0°，线束系统：0°，NTD：<el-input v-model="form.curveDataProfile.ntd" class="input-line" />cm，剂量率：<el-input v-model="form.curveDataProfile.doseRate" class="input-line" />Gy/min，预设剂量：10Gy。</div>
        <table border="1" cellspacing="0" cellpadding="0" align="center">
            <tr>
              <td rowspan="2">能量档 <br/>（MeV）</td>
              <td rowspan="2">照射野 <br/>（cm）</td>
              <td rowspan="2">检测深度 <br/>（cm）</td>
              <td rowspan="2">方向</td>
              <td colspan="3">均整度（mm）</td>
              <td rowspan="2">对称性 <br/>（%）</td>
              <td colspan="2">检测半影（mm）</td>
              <td colspan="2">厂家规定半影<br>（mm）</td>
            </tr>
            <tr>
              <td></td>
              <td>左</td>
              <td>右</td>
              <td>左</td>
              <td>右</td>
              <td>左</td>
              <td>右</td>
            </tr>
            <tbody v-for="tbodyIndex in curveDataProfile.table.tbody" :key="tbodyIndex">
              <template v-for="tbody2Index in curveDataProfile.table.tbody2">
                <tr>
                  <td v-if="tbody2Index == 1" :rowspan="curveDataProfile.table.tbody2*6"><el-input v-model="form.curveDataProfile['energy_'+tbodyIndex]" class="input-line" /></td>
                  <td class="multipleInput" rowspan="6">
                    <div style="display: flex;">
                      <el-input v-model="form.curveDataProfile['irradiationField_'+tbodyIndex+'_'+tbody2Index+'_left']" class="input-line" /><i>$\times$</i><el-input v-model="form.curveDataProfile['irradiationField_'+tbodyIndex+'_'+tbody2Index+'_right']" class="input-line" />
                    </div>
                  </td>
                  <td rowspan="4"><el-input v-model="form.curveDataProfile['depth_'+tbodyIndex+'_'+tbody2Index+'_1']" class="input-line" /></td>
                  <td>AB</td>
                  <td>A</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_left_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_right_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_factory_left_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_factory_right_'+tbodyIndex+'_'+tbody2Index+'_ABA']" class="input-line" /></td>
                </tr>
                <tr>
                  <td>正</td>
                  <td>C</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_ZC']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_ZC']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_ZC']" class="input-line" /></td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                </tr>
                <tr>
                  <td>GT</td>
                  <td>A</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_left_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_right_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_factory_left_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['detectPenumbra_factory_right_'+tbodyIndex+'_'+tbody2Index+'_GTA']" class="input-line" /></td>
                </tr>
                <tr>
                  <td>负</td>
                  <td>C</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_FC']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_FC']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_FC']" class="input-line" /></td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                </tr>
                <tr>
                  <td rowspan="2"><el-input v-model="form.curveDataProfile['depth_'+tbodyIndex+'_'+tbody2Index+'_2']" class="input-line" /></td>
                  <td>AB</td>
                  <td>B</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_ABB']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_ABB']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_ABB']" class="input-line" /></td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                </tr>
                <tr>
                  <td>GT</td>
                  <td>B</td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_left_'+tbodyIndex+'_'+tbody2Index+'_GTB']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['uniformity_right_'+tbodyIndex+'_'+tbody2Index+'_GTB']" class="input-line" /></td>
                  <td><el-input v-model="form.curveDataProfile['symmetry_'+tbodyIndex+'_'+tbody2Index+'_GTB']" class="input-line" /></td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                  <td>——</td>
                </tr>
              </template>
            </tbody>
          </table>
  </div>
</template>

<script>
  import {getInfoById, postInfo} from '@/api/testItem/item51';
  export default{
    name:'equipmentQualityControlTestingResults',
    props: {
    	// tab栏
      activeTab: {
    		type: String,
        default: "0",
      },
    	// 基本信息数据
      basicForm: {
    		type: Object,
        default: () => {
    			return {}
    		},
      },
    },
    data(){
      return{
        initFlag:false,
        doseCharacteristics:{
          action:'doseCharacteristics',
          flag:true,
          loading:false,
          notNumber:['date'],
          intNumber:[],
          like:false,
        },
        repeatability:{
          action:'repeatability',
          flag:true,
          loading:false,
          notNumber:['type','irradiation'],
          intNumber:[],
          like:true,
          table:{
            td:5,
            tr:9
          }
        },
        changePosition:{
          action:'changePosition',
          flag:true,
          loading:false,
          notNumber:['isTest'],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tr:['0','180','270'],
            td:3
          }
        },
        rotationalVariation:{
          action:'rotationalVariation',
          flag:true,
          loading:false,
          notNumber:['isTest'],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tr:2,
            td:3
          }
        },
        dailyStability:{
          action:'dailyStability',
          flag:true,
          loading:false,
          notNumber:['testTime'],
          intNumber:[],
          like:true,
          table:{
            tr:2,
            td:3
          }
        },
        linearity:{
          action:'linear',
          flag:true,
          loading:false,
          notNumber:['beamType_1','beamType_2'],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            td1:5,
            td2:5,
            tr1:4,
            tr2:5
          }
        },
        pdd:{
          action:'pdd',
          flag:true,
          loading:false,
          notNumber:['energyType'],
          intNumber:[],
          like:false,
          table:{
            tr:2
          }
        },
        xProfile:{
          action:'xProfile',
          flag:true,
          loading:false,
          notNumber:[],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tbody2:2,
            tr:['AB','GT']
          }
        },
        curveDataPdd:{
          action:'curveDataPdd',
          flag:true,
          loading:false,
          notNumber:[],
          intNumber:[],
          like:false,
          table:{
            tr:7
          }
        },
        curveDataProfile:{
          action:'curveDataProfile',
          flag:true,
          loading:false,
          notNumber:[],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tbody2:2
          }
        },
        form:{
          doseCharacteristics:{

          },
          repeatability:{

          },
          changePosition:{

          },
          rotationalVariation:{

          },
          dailyStability:{

          },
          linearity:{

          },
          pdd:{

          },
          xProfile:{

          },
          curveDataPdd:{

          },
          curveDataProfile:{

          }
        }
      }

    },
    watch:{
      activeTab:{
        handler(val) {
          this.$nextTick(()=>{
            if(val == 4){
              let resultId = this.basicForm.resultId;
              getInfoById(resultId).then(response => {
                if(response.code == 200){
                  let data = response.data;
                  for(let keys in data){
                    this.setData(keys,data[keys]);
                  }
                   setTimeout(()=>{
                     this.initFlag = true;
                   },300)
                }
              }).catch((response) => {
                 this.$emit("loadingchange", true);
               });
               }
            });
        },
        deep: true,
        immediate: true
      },
      "form.doseCharacteristics":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'doseCharacteristics');
         }
        },
        deep:true,
      },
      "form.repeatability":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'repeatability');
         }
        },
        deep:true,
      },
      "form.changePosition":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'changePosition');
         }
        },
        deep:true,
      },
      "form.rotationalVariation":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'rotationalVariation');
         }
        },
        deep:true,
      },
      "form.dailyStability":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'dailyStability');
         }
        },
        deep:true,
      },
      "form.linearity":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'linearity');
         }
        },
        deep:true,
      },
      "form.pdd":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'pdd');
         }
        },
        deep:true,
      },
      "form.xProfile":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'xProfile');
         }
        },
        deep:true,
      },
      "form.curveDataPdd":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'curveDataPdd');
         }
        },
        deep:true,
      },
      "form.curveDataProfile":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'curveDataProfile');
         }
        },
        deep:true,
      },
    },
    methods:{
      //修改数据
      setData(name,data){
        this.form[name] = data ? data : (this[name] ? {}:null);
      },
      //表单修改提交后端
       postForm(param,name){
         param['itemsId'] = this.form.itemsId;
         this.$emit("loadingchange", true);
      	 postInfo(param,this[name].action).then(res=>{
      		 this.$emit("loadingchange", false);
      		 if(res.code == 200){
      			 this[name].flag = false;
      			 if(name != 'sdd'){
      				this.setData(name,res.data);
      			 }
      		 }
      	 })
      },
      validateType(arr,keys,obj){
      	if(obj.like){
      		for(let i=0;i<arr.length;i++){
      			if(keys.indexOf(arr[i]) != -1){
      				return true;
      			}
      		}
      		return false;
      	}else{
      		if(arr.indexOf(keys) != -1){
      			return true;
      		}
      		return false;
      	}
      },
       //数据验证
       validateData(newName,myName){
      	 if(!this[myName].noClear){
      		clearTimeout(this[myName].loading);
      	 }else{
      		 this[myName].noClear = false;
      	 }
         let regNumber = /^[-]?\d*([.](\d+))?$/;//小数验证正则
         let regRepNumber = /[^-?\d.,]/g;//将除小数外的符号消除正则
         let regInt = /^\d*$/;//整数验证正则
         let regRepInt = /[^-?\d,]/g;//将除小数外的符号消除正则
         let reg,regRep;
         let repStr = '';
      	 let intResult
         if(JSON.stringify(newName) != '{}'){
           //遍历该对象所有字段进行验证
           for(let keys in newName){
             //数字验证环节
      			 if((typeof newName[keys] == 'string') ||  (typeof newName[keys] == 'number')){
      				if(newName[keys] && !this.validateType(this[myName].notNumber,keys,this[myName])){
      					intResult = this.validateType(this[myName].intNumber,keys,this[myName]);
      					reg = intResult ? regInt:regNumber;
      				  let bool = !reg.test(newName[keys]);
      				  if(bool){
      						setTimeout(()=>{
      							intResult = this.validateType(this[myName].intNumber,keys,this[myName]);
      							regRep = intResult ? regRepInt:regRepNumber;
      									repStr = newName[keys] + '';
      							repStr =  repStr.replace(regRep,'');
      							if(repStr != (newName[keys]+'')){
      								if(!this[myName].noClear){
      									this[myName].noClear = true;
      								}
      								newName[keys] = repStr;
      							}
      						},100);
      						if(this[myName].flag){
      						 this[myName].flag = false;//如果数字验证不通过不需要请求后端
      						}
      				  }
      				}
      			 }
           }
      		 this.isPost(newName,myName);
         }
       },
       isPost(newName,myName){
      	 if(this[myName].flag){//是否请求后端判断
      	  let postBody = {};
      	  for(let i in newName){
      	    if(newName[i] !== null && newName[i] !== undefined){
      	      postBody[i] = newName[i];
      	    }
      	  }
      	  if(JSON.stringify(postBody) != '{}'){
      			this[myName].loading = setTimeout(()=>{
      				this.postForm(postBody,myName);
      			},800)
      	  }
      	 }else{
      		 this[myName].flag = true;
      	 }
       },
    },
  }
</script>

<style lang="scss" scoped>
  @import '../content.scss';

  .miniFont {
    font-size: 10px;
  }

  .miniFontCenter {
    margin-top: 8px;
  }

  .content51 {
    padding-inline: 0 !important;
    ::v-deep .el-input__suffix{
      display: none;
    }
    .latex{
      margin-top: 15px;
    }
    table {
      width: 100%;

      td {
        max-width: 100px;

        ::v-deep .el-checkbox__label {
          white-space: break-spaces;
        }
      }

      .el-input {
        width: 100% !important;
      }

      .multipleInput {
        .el-input {
          width: 50px !important;
        }
      }
    }
    .input100 {
      .el-input {
        width: 100px !important;
      }
    }

    .innertitle {
      display: block;
      margin-left: 0;
    }

    .table1 {
      .el-radio {
        display: flex;
        align-items: center;
      }
    }

    #hearderTR td:nth-child(7) {
      display: none;
    }
  }
</style>
